jQuery(document).ready(function($) {
	//想读
	$('.want').click(function(){
		//$('.dialog-popover-mask').fadeIn(10);
		$('.dialog-want').slideDown(300);
	})
	$('.dialog-poptit .close').click(function(){
		//$('.dialog-popover-mask').fadeOut(10);
		$('.dialog-want').slideUp(300);
	})
    //正在读这本书
	$('.reading').click(function(){
		//$('.dialog-popover-mask').fadeIn(10);
		$('.dialog-reading').slideDown(300);
	})
	$('.dialog-poptit .close').click(function(){
		//$('.dialog-popover-mask').fadeOut(10);
		$('.dialog-reading').slideUp(300);
	})
	//读过
	$('.read').click(function(){
		//$('.dialog-popover-mask').fadeIn(10);
		$('.dialog-read').slideDown(300);
	})
	$('.dialog-poptit .close').click(function(){
		//$('.dialog-popover-mask').fadeOut(10);
		$('.dialog-read').slideUp(300);
	})
	//修改
	$('.read-edit').click(function(){
		//$('.dialog-popover-mask').fadeIn(10);
		$('.dialog-edit').slideDown(300);
	})
	$('.dialog-poptit .close').click(function(){
		//$('.dialog-popover-mask').fadeOut(10);
		$('.dialog-edit').slideUp(300);
	})
	//登录框
	$('.reglgdialog').click(function(){
		//$('.dialog-popover-mask').fadeIn(10);
		$('.dialog-login').slideDown(300);
	})
	$('.dialog-poptit .close').click(function(){
		//$('.dialog-popover-mask').fadeOut(10);
		$('.dialog-login').slideUp(300);
	})

	//评分输入提示
	$("#savebutton-reading").click(function(){
		if($('input:radio[name="rating-reading"]:checked').val()==null) {
			$(".ms-reading").html("<span class='ms-ok'><font color='red'>请给本书评分。</font></span>");
			$(".ms-ok").fadeOut(3000);
		}
		else {
			reading.submit();
		}
	})
	$("#savebutton-read").click(function(){
		if($('input:radio[name="rating-read"]:checked').val()==null) {
			$(".ms-read").html("<span class='ms-ok'><font color='red'>请给本书评分。</font></span>");
			$(".ms-ok").fadeOut(3000);
		}
		else {
			read.submit();
		}
	})

	//切换显示评分是否可选
	$("#want-edit").click(function(){		
		$('input:radio[name="rating-edit"]').attr("disabled","disabled");
		$(".pftit-edit").html("未读书籍暂不能评分：");
		$(".star1").html("<span class='bigstar00'></span>");
		$(".star2").html("<span class='bigstar00'></span>");
		$(".star3").html("<span class='bigstar00'></span>");
		$(".star4").html("<span class='bigstar00'></span>");
		$(".star5").html("<span class='bigstar00'></span>");		
	})

	$("#reading-edit").click(function(){		
		$('input:radio[name="rating-edit"]').removeAttr("disabled");
		$(".pftit-edit").html("给本书评分：");
		$(".star1").html("<span class='bigstar10'></span>");
		$(".star2").html("<span class='bigstar20'></span>");
		$(".star3").html("<span class='bigstar30'></span>");
		$(".star4").html("<span class='bigstar40'></span>");
		$(".star5").html("<span class='bigstar50'></span>");		
	})

	$("#read-edit").click(function(){		
		$('input:radio[name="rating-edit"]').removeAttr("disabled");
		$(".pftit-edit").html("给本书评分：");
		$(".star1").html("<span class='bigstar10'></span>");
		$(".star2").html("<span class='bigstar20'></span>");
		$(".star3").html("<span class='bigstar30'></span>");
		$(".star4").html("<span class='bigstar40'></span>");
		$(".star5").html("<span class='bigstar50'></span>");		
	})

})

function r_remove() {
	var msg="您确定要删除这个收藏吗？";
	if (confirm(msg)==true){
		return true;
	}
	else {
		return false;
	}
} 
